package com.wzz.sparkProject

import org.apache.spark.sql.SparkSession

object SparkUtils {
  def getSparkSession(appName:String) = {
    if(ConfigUtils.LOCAL_RUN){
      val spark: SparkSession = SparkSession.builder()
        .master("local[*]")
        .appName(appName)
        .enableHiveSupport()
        .getOrCreate()
      spark
    }else{
      val spark: SparkSession = SparkSession.builder()
        .master("yarn")
        .appName(appName)
        .enableHiveSupport()
        .getOrCreate()
      spark
    }
  }
}
